﻿Imports capaNegocios

Public Class secAlumno_buscar
    Inherits System.Web.UI.Page

    Dim codAlumno As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objAlumno As New clsAlumno
        objAlumno.apellidoPaterno = Request.QueryString("apePat")
        objAlumno.apellidoMaterno = Request.QueryString("apeMat")
        Me.dgvAlumno.DataSource = objAlumno.Buscar()
        Me.dgvAlumno.DataBind()
    End Sub

    Protected Sub btnModificarAlumno_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnModificarAlumno.Click
        If dgvAlumno.SelectedIndex <> -1 Then
            codAlumno = dgvAlumno.Rows(dgvAlumno.SelectedIndex).Cells(1).Text
            Response.Redirect("secAlumno_modificar.aspx?codAlum=" & codAlumno)
        Else
            MsgBox("Seleccione al alumno que desea modificar")
        End If
    End Sub

    Protected Sub btnBuscarAlumno_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnBuscarAlumno.Click
        Dim objAlumno As New clsAlumno
        Dim apePaterno, apeMaterno As String
        apePaterno = Me.txtApellidoPaternoBuscar.Text
        apeMaterno = Me.txtApellidoMaternoBuscar.Text

        If apePaterno <> "" Or apeMaterno <> "" Then
            'Me.dgvAlumno.DataSource = objAlumno.Buscar()
            'Me.dgvAlumno.DataBind()
            Response.Redirect("secAlumno_buscar.aspx?apePat=" & apePaterno & "&apeMat=" & apeMaterno)
        Else
            MsgBox("Debe ingresar criterios de búsqueda.")
        End If
    End Sub

    Protected Sub dgvAlumno_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles dgvAlumno.SelectedIndexChanged

    End Sub
End Class